/**
 * Created by Administrator on 2015/8/11.
 */
$(document).ready(function(){
    var $a=$(".navbar-inverse .navbar-header a");
    var divWidth=$(".navbar-inverse").width();
    var divHeight=$(".navbar-inverse").height();
    //var $liHeight=$("ul li").height();
    var btnWidth=$(".navbar-inverse .navbar-header button").width();
    var aWidth=$a.width();
    var $row=$("ul li .row").height();
    var $img=$("ul li .row .col-xs-3 img");
    var $search=$("#search");
    var $search_btn=$("#search-btn");
    var $img1=$("#float-li");
    var count;
    window.onload= function () {
        $a.css({
            position: 'absolute',
            left:divWidth/2-aWidth/2-btnWidth/2
        });
        $img.css("margin-top",($row-$img.height())/2);
        $search_btn.css("top",$search.offset().top+($search.height()-$search_btn.height())/2)
    }
    $(".list-group-item").on("click",function(){
        $(this).addClass("li-background").siblings("li").removeClass("li-background");
        count=parseInt($(this).index());
        var $liHeight=$(this).height();
        $("#float-li").css({top:divHeight+($liHeight+20)*count+3,display:'block',height:$liHeight+19,right:0,width:10})
    })
})